{
    // let xx = this

    let a = {
        x: 3,
        y: 4,
        u2: () => {
            console.log(this.x) // `this` is undefined
        }
    }
    let b1 = a.x
    // let b2 = new a()  // `a` is an object, and we cannot `new` an object.

    // dynamic：可以动态添加属性和方法
    a.z = 5
    a.u = function () {
        console.log(this.x)
        // console.log('Hi!')
    }
    // a.u = () => {
    //     console.log(this.x)
    // }

    console.log(a)
    a.u()
    a.u2()
}


// =============================
{
    class Cls {
        x = 3
        y = 4
        u2 = () => {
            console.log(`Hi, ${this.x}!`)
        }
    }

    new Cls().u2()
}
